﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes {
    import __AS3__.vec.*;

    public class Quest {

        protected var m_xml:XML = null;
        private var m_name:String;
        private var m_icon:String;
        private var m_feed:String;
        private var m_delay:int;
        private var m_popupDelay:int;
        private var m_visible:Boolean;
        private var m_tasks:Vector.<Object>;
        private var m_rewards:Vector.<String>;
        private var m_purchased:Vector.<Boolean>;
        private var m_extraData:Object;

        public function Quest(_arg1:XML){
            var _local4:Object;
            this.m_tasks = new Vector.<Object>();
            this.m_rewards = new Vector.<String>();
            this.m_purchased = new Vector.<Boolean>();
            super();
            this.m_xml = _arg1;
            this.m_name = String(_arg1.@name);
            this.m_icon = String(_arg1.@url);
            this.m_feed = String(_arg1.@feed);
            this.m_delay = int(_arg1.@delay);
            this.m_popupDelay = int(_arg1.@popup_delay);
            this.m_visible = (String(_arg1.@visible) == "true");
            this.m_extraData = null;
            var _local2:int;
            while (_local2 < this.m_xml.tasks.task.length()) {
                _arg1 = this.m_xml.tasks.task[_local2];
                _local4 = new Object();
                _local4.action = String(_arg1.@action);
                _local4.type = String(_arg1.@type);
                _local4.total = int(_arg1.@total);
                _local4.max = int(_arg1.@max);
                _local4.filter = String(_arg1.@filter);
                _local4.sticky = (String(_arg1.@sticky) == "true");
                _local4.stickyType = (String(_arg1.@stickyType)) ? String(_arg1.@stickyType) : StickyType.NONE;
                _local4.percent = (String(_arg1.@percent) == "true");
                _local4.icon = String(_arg1.@icon_url);
                this.m_tasks.push(_local4);
                this.m_purchased.push(false);
                _local2++;
            };
            var _local3:int;
            while (_local3 < this.m_xml.rewards.reward.length()) {
                this.m_rewards.push(String(this.m_xml.rewards.reward[_local3].@url));
                _local3++;
            };
        }
        public function addExtraData(_arg1:Object):void{
            this.m_extraData = _arg1;
        }
        public function get extraData():Object{
            return (this.m_extraData);
        }
        public function get name():String{
            return (this.m_name);
        }
        public function get icon():String{
            return (this.m_icon);
        }
        public function get feed():String{
            return (this.m_feed);
        }
        public function get delay():int{
            return (this.m_delay);
        }
        public function get popupDelay():int{
            return (this.m_popupDelay);
        }
        public function get visible():Boolean{
            return (this.m_visible);
        }
        public function get tasks():Vector.<Object>{
            return (this.m_tasks);
        }
        public function get rewards():Vector.<String>{
            return (this.m_rewards);
        }
        public function get purchased():Vector.<Boolean>{
            return (this.m_purchased);
        }
        public function wasAnyTaskPurchased():Boolean{
            var _local1:Boolean;
            for each (_local1 in this.m_purchased) {
                if (_local1){
                    return (true);
                };
            };
            return (false);
        }

    }
}//package Classes 
